#include<iostream>
#include<fstream>
#include<string>
using namespace std;
void Create_a_txt(const char * file1)
{
	ofstream out_file(file1,ios::out);
	if(!out_file)
	{
		cout<<"file error"<<endl;
		return;
	}
	out_file<<"how are you?"<<endl;
	out_file<<"i'm fine thank you and you?"<<endl;
	out_file.close();
	return;
}
void copy_a_txt(const char * file1,const char * file2)
{
	ifstream from_file(file1);
	if(!from_file)
	{
		cout<<"file erro"<<endl;
		return;
	}
	ofstream to_file(file2);
	string temp;
	while(getline(from_file,temp))
	{
		to_file<<temp<<endl;
	}
	from_file.close();
	to_file.close();
}
void print_a_txt(const char *file)
{
	ifstream out_file(file);
	string temp;
	while(getline(out_file,temp))
	{
		cout<<temp<<endl;
	}
	out_file.close();
}
int main()
{
	const char * file_1="file_1.txt";
	const char * file_2="file_2.txt";
	Create_a_txt(file_1);
	print_a_txt(file_1);
	copy_a_txt(file_1,file_2);
	print_a_txt(file_2);
}

